

********************************************************************************
* Figure 3: Different Sample Periods
********************************************************************************

*********************************
* (A) Since 1980
*********************************

use "../data/final_data_fed_secular_decline", clear

keep if date >= mdy(1,1,1980)
drop if date >= mdy(7,1,2021)

local x "sveny10_chg"

sort date
generate FOMC_change  = `x'  if  !missing(fomc_meet[_n+1]) | !missing(fomc_meet) | !missing(fomc_meet[_n-1])
generate nonFOMC_change  = `x'  if missing(fomc_meet[_n+1]) & missing(fomc_meet) & missing(fomc_meet[_n-1])

gen cum_`x'			= sum(`x')
gen cum_FOMC_change = sum(FOMC_change)
gen cum_nonFOMC_change 	= sum(nonFOMC_change)

line cum_`x' cum_FOMC_change date, ///
scheme(s1mono) lcolor(gs6 red) ///
xlabel(, format(%tdCCYY)) ///
ylabel(, angle(horizontal)) ///
ytitle("Cumulative yield change (%)") ///
xtitle("") ///
legend(cols(1) pos(2) ring(0) symxsize(*0.5) ///
label(1 "10y Treasury yield") label(2 "10y Treasury yield change around FOMC meetings") )
graph export "../figures/figure3a.png", replace	


*********************************
* (B) Since 1994
*********************************

use "../data/final_data_fed_secular_decline", clear

keep if date >= mdy(1,1,1994)
drop if date >= mdy(7,1,2021)

local x "sveny10_chg"

sort date
generate FOMC_change  = `x'  if  !missing(fomc_meet[_n+1]) | !missing(fomc_meet) | !missing(fomc_meet[_n-1])
generate nonFOMC_change  = `x'  if missing(fomc_meet[_n+1]) & missing(fomc_meet) & missing(fomc_meet[_n-1])

gen cum_`x'			= sum(`x')
gen cum_FOMC_change = sum(FOMC_change)
gen cum_nonFOMC_change 	= sum(nonFOMC_change)

line cum_`x' cum_FOMC_change date, ///
scheme(s1mono) lcolor(gs6 red) ///
xlabel(, format(%tdCCYY)) ///
ylabel(, angle(horizontal)) ///
ytitle("Cumulative yield change (%)") ///
xtitle("") ///
legend(cols(1) pos(2) ring(0) symxsize(*0.5) ///
label(1 "10y Treasury yield") label(2 "10y Treasury yield change around FOMC meetings") )
graph export "../figures/figure3b.png", replace	